package com.lg.concurrent.lock;

import lombok.SneakyThrows;

import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;

public class ReentrantLockTest {
    @SneakyThrows
    public static void main(String[] args) {
        ReentrantLock reentrantLock = new ReentrantLock();
        reentrantLock.tryLock(1, TimeUnit.SECONDS);
        reentrantLock.lockInterruptibly();
        Condition condition = reentrantLock.newCondition();
        condition.await();
        condition.signal();
    }
}
